Welcome back.
The last thing we need to do for our lobby is to actually test whether or not our teleportation system
works.
In order to do this, we need to create a new place in our game to teleport our players to.
This new place is going to act as the story part for our horror game.
So in order to create a new place, we can go to the file tab up here and we can go to Game Settings.
And we can go down to the section of places.
And here's where we can create a new place within this same game.
So if I hit create here, it's going to add a new place here.
And we can go ahead and configure this place.
We can change the name to something like I'll just call it maybe story section.
Or we can call it part one if you want to make multiple parts or whatever.
But I could just call it main story.
We could just leave this all at the defaults.
Roblox optimized and things like that.
And then we can go ahead and save this place.
Now that we have created a new place, we need to go ahead and copy the ID for it so we can go to the
view tab and open up our asset manager.
And we should be able to go to places here and here.
We show our two places.
This is going to be where our horror game is at.
And then this is going to be the main story place.
And then we can go ahead and copy this ID to the clipboard.
We can take this ID and go back into our server service and update the start place ID with this new
ID now that we have that done, we can go ahead and publish our game to Roblox.
So if you haven't published it already, make sure you do.
So I'm just going to overwrite my original save here with this place.
Hit overwrite and now my game is published and we can go ahead and test out our teleportation system
in the actual Roblox game player.
All right, so now I'm in my core game inside of the Roblox player.
And as you can see, when I hit F9 on the console, we get to see all the print statements printed out
that the client was loaded and everything was loaded, initialized, and started.
And then we can go to the server and see that all went well on the server as well.
Now we can go ahead and create a new server.
I'll just create it with the size of one, create the server, and I want to start this game with just
me inside of it, and it should be able to teleport us back to our starting place.
And it looks like we got an error of attempted to teleport to a place that is restricted.
So it appears that we actually may need to go and edit the settings in that place and make it actually
playable.
So back in studio here, I believe one thing I forgot to change inside of our game settings is that
we need to change the permission for our game, and we want to go ahead and make this game public.
And then the next thing we need to do is we actually need to go into our second place.
So I'm going to open it up here.
And inside of our main story place.
We actually want to go into the game settings for this one as well, and make sure we change the permission
to public.
And then we also want to make sure that we have allow third party teleports enabled.
So if we save that and then go ahead and publish this as well.
We should be able to teleport to our other place now.
Okay, so now hopefully this should be working.
If we go to create a new server and we want to start the game and get teleported to the next section,
hopefully we won't get that error anymore and it doesn't seem like we're going to get the error.
There we go.
We got teleported to our next place.
Very nice.
Now the next thing we need to do is to go ahead and script and set up the story part for our horror
game, and let's go ahead and do that real quick.
So now we're back into our starting or main story place, and I attached a model to this lecture that
you're going to want to go ahead and grab and insert into your game.
It contains all of the assets for the story mode that we're going to need.
So you want to go ahead and click on that and insert it into your game.
Once you actually have it inside of your My model section.
And now that we have our place inside of the game, oops, we zoomed out way too much.
Let me go ahead and come in real quick here.
So if I go to a part there we go.
All right.
So we have our map here.
Very nice.
And what we're going to need to do is to delete the original base plate in our game.
And we can go ahead and get rid of the original spawn location as well.
So this is going to be our total and complete map.
Any players that join into the server are all going to be spawned inside of this box here.
And how it's going to start, because we're going to have every single player's camera attached to an
invisible part here on this bus.
And this bus is going to drive down as our camera follows it all the way to the restaurant, and our
player is going to get dropped off here and they're going to go inside of our building.
Go ahead and ignore these models for now, because they're actually supposed to be in server storage
and replicated storage and things like that.
Currently, all of the different assets are in the workspace, which it won't be like that when we've
actually ungrouped all of these different things into their respective services.
But we can go ahead and take a look around at the map here.
Again, similar layout to the lobby.
Instead, uh, I had some extra rooms filled out, like we have the restroom here, which we'll be using
to complete some tasks for the toilet.
We have a nice kitchen filled out the office, and then I've added a basement section in the back here.
And this is going to be the area where the players are going to be wandering around the map, looking
for a key and avoiding our AI monster who's going to hunt them down.
Eventually, their goal is to unlock this door and enable the breaker to open up the exit door.
And when they hit the exit door, basically our game will be over.
We have a bunch of these different points in here that our AI Squidward is going to pathfind to.
He falls out and spawns from the ceiling.
So I have different zones in the ceiling.
Let me go ahead and see if I can find one of them.
Here's one of them, so we'll spawn them up here at a position he'll walk down, fall through the ceiling,
and begin to pathfind around the map.
Once he reaches a specific amount of iterations to the map and he didn't see any players, we'll respawn
him and he'll fall out of a different spot inside of the ceiling, such as over here.
So we've definitely got a lot of work ahead of us.
But to get the main things out of the way, let's go ahead and move all of these different models into
their respective services.
So the first thing here we can move is this model into the lighting service.
So let's go ahead and delete all of this stuff in here.
And then we can take this.
Put it in the lighting service and ungroup it using Ctrl and U.
The next thing we can do is take this and ungroup it in replicated first.
So Ctrl and U do the same thing with this.
For replicated storage, we want to do the same thing for the server script service.
For server storage as well.
This one is going to go into sound service.
This one is going to go into starter character scripts.
So we'll go ahead and move that into there as well.
This one's going to go into the starter GUI.
This one's going to go into starter player scripts.
And then we'll put this one in teams.
And then this last one is for the workspace.
So we can drag that in here and ungroup that.
And now the last thing we need to do is open up our Readme document and apply some settings inside of
the lighting service.
So inside of the lighting service our ambiance should be 000, brightness should be zero, the diffuse
scale should be something like 0.4.
The specular scale something like 0.2.
The outdoor ambiance should also be 000.
Make sure the lighting technology is on future.
We're going to set the clock time to zero.
And then for the fog, we want to have it start off at like something like five studs and end at 125
studs, and we're going to make the fog color completely black.
So now if we go back into our game, as you can see, it is completely pitch black outside other than
the lights illuminating the street.
And we can come inside of our bright, nicely lit restaurant with our restroom.
We have the kitchen, the office, and then the dark basement that's only illuminated by these light
sources that will go out when the power goes out in our story.
You might notice that we have a whole bunch of different scripts in here, but of course they're all
empty.
We're going to go ahead and have to fill out all of these scripts on our own.
So that's going to be a lot of work, but it's also going to be a lot of fun once we've actually gotten
our game up and running.
Of course, the next things you're going to want to do is you're going to want to make sure that you
have all of the different animations for a regular Squidward uploaded.
So since you already uploaded animations for this guy when we had him in our starting place, you can
go ahead and take those IDs and copy them into their respective animations, or you can directly copy
your original Squidward from the lobby, get his animations out of those ones, and copy the IDs in
here.
But nonetheless, your animations should be within your inventory.
So if you actually go to my animations inside of your toolbox, you'll be able to see the animations
that you've uploaded, and you can copy those IDs and paste them into the different animation, uh,
instances.
And then for our handsome Squidward, I let me actually put him in the workspace.
So if we go to other stuff and server storage, we have our handsome Squidward I we put him in the workspace
and we'll find him here he is.
He has some animations in here that you're going to have to upload.
You want to upload his walking animation, his running animation as well as his idalene animations.
So make sure you go ahead and go to the avatar tab.
Open up the animation editor, select him and make sure you get all of his different animations uploaded,
such as as a walking animation.
We'll load his running animation.
As well as his other idling animations such as this one and.
Um, I think we'll be able to use this one as well.
So make sure you get those animations uploaded and once you've copied the IDs, you can go to the animate
script that's already inside of our handsome Squidward AI, and you'll want to put them inside of,
for example, the walk animation.
You'll put the ID in here for the running animation.
You'll put it in here.
Uh, for the idle animation, you can put the main one inside of idle animation one, and then the one
where he looks around, you can put that one in animation number two, all of the other different animations
you're not going to have to worry about because he's not going to sit, swim or do any of the other
stuff.
These are just all of the different default animations that are originally for players, but you're
not going to have to worry about those.
The only ones you're going to have to worry about are his idling animations, his walking, and his
running animation.
All right, so the next thing I wanted to take a look at with you are the different guys that we have
inside of our starter GUI.
So let me go ahead and make sure UI visibility is enabled, which it is.
And here is our main guy.
So currently it's enabled.
But all of the frames aren't.
But basically what's going to happen is we're going to have a bunch of different frames for particular
things.
So for example, we're going to have this frame enabled on our screen.
That's going to show us the current objectives that we need to complete in our story.
Such objectives could be something like completing tasks, earning enough money to pay rent, because
that's how the story is going to go.
We have to make enough money to earn rent.
Uh, it'll give you tasks like go look for a particular thing, find a way out of the basement and things
like that.
We're also going to have a frame for displaying the current tasks that we must complete.
So in the beginning, we're going to have a bunch of tasks for the player, such as cleaning the tables,
sweeping the floor, uh, stocking the kitchen and cleaning the toilets and stuff like that.
And we have different, uh, props around the map to do those things for.
We're going to have this frame for when the player dies and they can go and spectate people.
And there's also a button for them to respawn.
And we're going to charge them Robux.
So when they die, they can buy a developer product for like ten Robux or 25 Robux or whatever you'd
like to price it for them to respawn back into the basement.
We're also going to have this frame here.
Um, currently all of the labels are transparent, but when the player escapes from the basement or
they fail to escape from the basement, it's going to give this outro frame to them, giving them information
like, uh, their stats for the game, how much money they earned, how many tasks they completed,
and things like that.
This frame we're going to display onto their screen when they collect some money.
So we're going to have money scattered around the map that players can find.
And they can pick that stuff up to earn more money for themselves.
Currently, I believe these are all set to be transparent as well, but if I try to change the transparency,
we'll basically have this little money logo and a dollar amount and it'll just kind of float up their
screen a little bit and then fade out and we'll play like a little, uh, money collection sound.
So that's how we're kind of going to do that one as well.
This frame here is going to be at the very beginning of our game.
It's going to give some context for the players.
So when they join the game, it'll give us the time.
11 p.m. it'll display another message like you're on the way to the Krusty Krab on a bus.
And basically it'll tell them, make sure you get enough money to earn rent.
And then this frame we're going to display onto the screen when they die.
So when they get killed by the handsome Squidward, we're going to basically fade this thing in, which
is a black screen, and we're going to display a text label to them of you died.
So I believe I have to change the text transparency.
So change that to zero.
It'll say you died and they'll go into the spectate frame.
Another thing we have here is a little text label for a countdown, so they'll have a certain amount
of time to complete all of the tasks and fulfill their task objective, and that will be counting down
at the top of their screen.
And then this small little text label down here is going to be displaying information or messages to
the player.
So for example, if they try to open a door that's locked, a little message will appear at the bottom
of their screen that says the door is locked.
Or for example, maybe they try to sweep the floor without using a broom.
It'll display to them that, hey, you need a broom to complete this task, and things kind of like
that.
It allows the server basically to give a message to a specific player.
This other guy that we're going to have here is going to display the messages in the game.
So basically, our Squidward friend here is going to talk, his image is going to appear here, and
his name will be down here, and this box will have him, uh, saying out messages.
So we'll have like a typewriting effect where the message will slowly appear out and the players can
go ahead and read that.
And, you know, our Squidward friend here is basically talking, and then this last guy here is going
to be our stamina guy, which will display to the players how much stamina they have left.
So there will be a border and a fill, and that fill will go up and down depending on how much stamina
the player has.
Pretty simple guy for that one as well.
Now before I forget, we actually have one more thing we need to upload animations for and that's in
replicated storage.
We have a model in here that we're going to use for jumpscares.
So when the AI Squidward grabs one of the players or attacks one of the players, we're going to jump
scare them.
Using this jump scare model.
So if I drag this into the workspace and we can go ahead and go to it, it's currently dark, but we
have another Squidward in here and a dimly lit room, and we're basically going to have the player's
camera, like, right up in his face, and he's going to go ahead and jump scare them.
So if we go to our Squidward friend here, unfortunately, I don't believe I saved the jump scare animation
for him, but that's okay because this gives you a little bit of an opportunity to mess with the animation
editor.
So we can go to the animation editor.
Select our Squidward friend here.
And for this animation clip we can just call this jumpscare one.
And we don't need to do anything particularly fancy.
But what I could do here is we could just basically have the head position kind of forwards a little
bit.
That might be a little bit too much.
Let me enable the move and like move it back a little bit so we could have the head go forward a little
bit.
We could have it maybe look slightly up, something like that.
And basically what we'll just do is we'll just have this head rotate back and forth a bunch of times.
So what we could do here is I could just have this rotated something like this to the left, and then
we move a couple frames down and rotate it something to the right.
And then we can just have it rotate back to the left again.
And we'll basically just loop this.
So this kind of head shaking animation will be playing in front of their screen.
And we'll play a loud sound at them.
So this is just kind of our basic little jump scare.
You could also do something with his arms as well.
Like have his arms reach out and grab something.
This is kind of like some freedom for you to mess around with moving the bones of this character here.
But basically, once you've got your jump scare animation figured out, you'll want to go ahead and
set the animation priority to action, make sure it's looped, and then you can go ahead and publish
this to Roblox.
So this is going to be my jump scare one for handsome Squidward.
Submit that bad boy.
You can go ahead and copy your ID and paste that inside of the jump scare animation instance right here,
and just paste your ID in there.
And in fact, one more thing before I actually forget, I've also attached a rain plugin to this lecture
that's going to emulate rain Forest in the game.
So you want to go ahead and grab that plugin as well.
Go to your My Plugins section, click it and make sure you install it into studio.
And once you've installed it, you can go to the plugins tab and open up the editor for our rain here.
And basically there's a few settings that we'll want to change for our rain.
So let me go ahead and go back into our workspace.
Let me find the map here.
It's kind of hard to see when it's so dark.
Here.
We'll go back to our main restaurant, and then we'll make sure to move our jump scare model back into
replicated storage.
So don't forget that as well.
Put that inside of your instances folder.
But basically here for our rain editor you're going to want to firstly enable it.
And it will ask you do you want to allow plugin Rain plugin to manage scripts in your game?
You will hit allow.
It's okay.
And then we'll make sure we've got this enabled.
And once you've got that enabled, it's going to insert a rain script inside of starter player scripts
for you.
And now we can go ahead and edit some settings within our reign editor.
So for the intensity, you'll want to set that to something like 0.6.
For the light emission you can keep that at 0.5.
And then for the light influence you can decrease it to something like around 0.8.
The speed ratio, you're going to want to definitely decrease to something like around 0.8 as well.
And the transparency you can keep at zero and the volume you can keep at point two.
And then down here you want to change the transparency threshold to something like 0.98.
And then you also want to enable that roofs must be can collide.
Because this rains particles interact with objects.
In our game we have this invisible roof over the restaurant.
That way rain can't get inside of the building because the collision can be a little weird on parts
or unions like these.
So I've just put this invisible roof over the restaurant, just in case we don't see any rain coming
into the building.
And I've also put some other invisible parts around the map that way rain doesn't come into the basement
as well.
All right.
Other than that, I think we've got all of our setup complete.
The next thing we need to do is just script a bunch of stuff in our game.
So I'll go ahead and see you in the next lecture.